viona: reset device more completely #1033
Merged
+32
−25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
when I reboot a Debian 13 guest the NIC works again, but judging by viona.d output I think it's by.. accident? The rebootI think what I was seeing is that the guest negotiates multi-queue, configures the queues, then sets features again with the same bits (including MQ). We then try to SET_PAIRS to viona again but the queues are already out of reset because the guest just set them up. So our SET_PAIRS to the same value we'd set before fails, we don't SET_USEPAIRS to the same value again, and things continue "happily". This happens on first boot too, I just didn't see it above all theSET_PAIRS 0xbstill returns 0x10 (EBUSY), and there's noSET_USEPAIRS 0xb. instead, there's aSET_USEPAIRS 0x1?RING_SET_MSIand such.@dancrossnyc suggested that it would be better to have a method on
VirtQueuesto go reset all the viona rings regardless of whatVirtQueues.len()happens to be, which works out well.I noticed along the way that we don't SET_PAIRS back down to 1 on reset. I think in the case that a guest would boot with a legacy driver, reconfigure the NIC for multiqueue, then reboot to a legacy driver (I'm thinking iPXE -> Linux -> reboot as a hypothesis), the driver would be pretty confused? So I'm SET_PAIRS and SET_USEPAIRS back to 1 on reset to get closer to the initial device state.